﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WindowsWeChat.ViewModel;

namespace WindowsWeChat
{
    public class ViewModelLocator
    {
        public static readonly object Locker = new object();
        private static ViewModelLocator _Intance = null;
        /// <summary>
        /// 唯一实例
        /// </summary>
        public static ViewModelLocator Intance
        {
            get
            {
                if (_Intance == null)
                {
                    lock (Locker)
                    {
                        _Intance = new ViewModelLocator();
                    }
                }
                return _Intance;
            }
        }
        #region 主界面ViewModel

        private MainViewModel _MainVM = null;
        /// <summary>
        /// 主界面VM
        /// </summary>
        public MainViewModel MainVM
        {
            get
            {
                return _MainVM ?? (_MainVM = new MainViewModel());
            }
        }
        #endregion
    }
}
